package libs

import (
	"crypto/md5"
	"encoding/json"
	"fmt"
)

func Md5(str string) string {
	var but []byte = []byte(str)
	hash := md5.New()
	hash.Write(but)
	return fmt.Sprintf("%x", hash.Sum(nil))
}

func PasswordMake(password string) string {
	return Md5(password)
}

func Str2Map(str string, result interface{}) error {
	return json.Unmarshal([]byte(str), result)
}
